package io.shallwe.task;

import com.jfinal.kit.LogKit;
import com.jfinal.plugin.IPlugin;
import org.tio.utils.thread.pool.DefaultThreadFactory;

/**
 * 产线信息维护线程
 */
public class LineInfoUpdatePlugIn implements IPlugin  {

    Thread thread=null;
    @Override
    public boolean start() {
        thread = new Thread(new LineInfoUpdateRunnable());
        thread.setDaemon(true);
        thread.setName("产线信息维护线程");
        thread.start();
        return true;
    }

    @Override
    public boolean stop() {
        if(thread!=null){
            try {
                thread.interrupt();
            }catch (Exception e){
                LogKit.warn(e.getMessage());
            }
        }
        return true;
    }
}
